part of '../../repository.dart';

const _kGooglePlayPurchasedItemIdentifierPurchaseTokenKey = 'purchase_token';
const _kGooglePlayPurchasedItemIdentifierPurchaseItemSkuKey = 'purchase_item_sku';

class _GooglePlayPurchasedItemIdentifierDto extends Equatable {
  const _GooglePlayPurchasedItemIdentifierDto._internal({
    required this.purchaseToken,
    required this.purchaseItemSku,
  });

  final String purchaseToken;
  final String purchaseItemSku;

  @override
  List<Object?> get props {
    return [
      purchaseToken,
      purchaseItemSku,
    ];
  }

  factory _GooglePlayPurchasedItemIdentifierDto.fromEntity(
      GooglePlayPurchasedItemIdentifier purchasedItemIdentifier) {
    return _GooglePlayPurchasedItemIdentifierDto._internal(
      purchaseToken: purchasedItemIdentifier.purchaseToken,
      purchaseItemSku: purchasedItemIdentifier.purchaseItemSku,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      _kGooglePlayPurchasedItemIdentifierPurchaseTokenKey: purchaseToken,
      _kGooglePlayPurchasedItemIdentifierPurchaseItemSkuKey: purchaseItemSku,
    };
  }
}
